using System;
using Caliburn.Micro;
using TimeKeeper.Results;

namespace TimeKeeper.Infrastructure
{
    public static class FactoryExtensions
    {
        public static IResult AsDialogResult<T>(this IViewModelFactory<T> viewModelFactory) where T : Screen
        {
            return new FactoryDialogResult<T>(viewModelFactory);
        }

        public static IResult AsDialogResult<T>(this IViewModelFactory<T> viewModelFactory, Action<T> initialization) where T : Screen
        {
            return new FactoryDialogResult<T>(viewModelFactory, initialization);
        }
    }
}